import useWebSocket from '@/hooks/UseWebsocket';
import { Button, Card, Checkbox, message, Result } from 'antd';
import React, { useEffect, useState } from 'react'
import { useIntl } from '@umijs/max';
import { SetupCard } from '@/utils/Send';
const ReturnThecard: React.FC = () => {

    const intl = useIntl();




    const SendCard2 = () => {
        let data = {
            "cardclass": "setcard",
            "setoveropen": "2",
            "setfalselock": "2",
            "uuid": "",
        }
          SetupCard(data)
        message.success(intl.formatMessage({id:"ManageCards.Overtime Close, fake lock Close card issuance successful"}))
    }

    const SendCard1 = () => {
        let data = {
            "cardclass": "setcard",
            "setoveropen": "1",
            "setfalselock": "1",
            "uuid": "",
        }
       SetupCard(data)
        message.success(intl.formatMessage({id:"ManageCards.Overtime successful"}))
    }

    const SendCard3 = () => {
        let data = {
            "cardclass": "setcard",
            "setoveropen": "1",
            "setfalselock": "2",
            "uuid": "",
        }
        SetupCard(data)
        message.success(intl.formatMessage({id:"ManageCards.Overtime open, fake lock Close card issuance successful"}))
    }
    const SendCard4 = () => {
        let data = {
            "cardclass": "setcard",
            "setoveropen": "2",
            "setfalselock": "1",
            "uuid": "",
        }
        SetupCard(data)
        message.success(intl.formatMessage({id:"ManageCards.Overtime Close, fake lock open card issuance successful"}))
    }
    return (
        <Card style={{ height: "100%" }}>
            <div style={{ padding: "20px 50px" }}>
                {/* <Checkbox onChange={onChange1}>超时禁音报警</Checkbox> 
                <Checkbox onChange={onChange2}>假锁禁音报警</Checkbox>
                <p></p>
                <Button type="primary" onClick={reTurnadmin}> 写静音卡 </Button> */}


                &emsp; <Button type="dashed" onClick={SendCard1}>{intl.formatMessage({id:"ManageCards.Overtime open, fake lock open"})} </Button> &emsp;
                &emsp; <Button type="dashed" danger onClick={SendCard2}>{intl.formatMessage({id:"ManageCards.Overtime Close, fake lock Close"})}</Button>&emsp;
                &emsp; <Button type="dashed" onClick={SendCard3}>{intl.formatMessage({id:"ManageCards.Overtime open, fake lock Close"})} </Button>&emsp;
                &emsp; <Button type="primary" ghost onClick={SendCard4}> {intl.formatMessage({id:"ManageCards.Overtime Close, fake lock open"})}  </Button>&emsp;

            </div>
        </Card>
    )
}

export default ReturnThecard
